import axios from '../utils/request';

class DeploymentAPI {
  private baseUrl = '/deployments';

  // 获取所有部署
  getAll() {
    return axios.get(this.baseUrl);
  }

  // 创建部署
  create(deploymentData: any) {
    return axios.post(this.baseUrl, deploymentData);
  }

  // 获取单个部署
  getById(id: string | number) {
    return axios.get(`${this.baseUrl}/${id}`);
  }

  // 更新部署
  update(id: string | number, updateData: any) {
    return axios.patch(`${this.baseUrl}/${id}`, updateData);
  }

  // 删除部署
  delete(id: string | number) {
    return axios.delete(`${this.baseUrl}/${id}`);
  }
}

// 导出单例
export default new DeploymentAPI();

